package com.yituo.mjworld.mvc.entity.web;

import javax.persistence.*;
import java.util.Arrays;

@Entity
@Table(name = "wx_userinfo", schema = "web_mojianworld_server", catalog = "")
public class WxUserinfo {
  private String userId;
  private String openid;
  private String nickname;
  private Integer sex;
  private String province;
  private String city;
  private String country;
  private String headimgurl;
  private byte[] unionid;

  @Id
  @Column(name = "userId", nullable = false, length = 36)
  public String getUserId() {
    return userId;
  }

  public void setUserId(String userId) {
    this.userId = userId;
  }

  @Basic
  @Column(name = "openid", nullable = true, length = 36)
  public String getOpenid() {
    return openid;
  }

  public void setOpenid(String openid) {
    this.openid = openid;
  }

  @Basic
  @Column(name = "nickname", nullable = true, length = 36)
  public String getNickname() {
    return nickname;
  }

  public void setNickname(String nickname) {
    this.nickname = nickname;
  }

  @Basic
  @Column(name = "sex", nullable = true)
  public Integer getSex() {
    return sex;
  }

  public void setSex(Integer sex) {
    this.sex = sex;
  }

  @Basic
  @Column(name = "province", nullable = true, length = 36)
  public String getProvince() {
    return province;
  }

  public void setProvince(String province) {
    this.province = province;
  }

  @Basic
  @Column(name = "city", nullable = true, length = 36)
  public String getCity() {
    return city;
  }

  public void setCity(String city) {
    this.city = city;
  }

  @Basic
  @Column(name = "country", nullable = true, length = 36)
  public String getCountry() {
    return country;
  }

  public void setCountry(String country) {
    this.country = country;
  }

  @Basic
  @Column(name = "headimgurl", nullable = true, length = 132)
  public String getHeadimgurl() {
    return headimgurl;
  }

  public void setHeadimgurl(String headimgurl) {
    this.headimgurl = headimgurl;
  }

  @Basic
  @Column(name = "unionid", nullable = true)
  public byte[] getUnionid() {
    return unionid;
  }

  public void setUnionid(byte[] unionid) {
    this.unionid = unionid;
  }

  @Override
  public int hashCode() {
    int result = userId != null ? userId.hashCode() : 0;
    result = 31 * result + (openid != null ? openid.hashCode() : 0);
    result = 31 * result + (nickname != null ? nickname.hashCode() : 0);
    result = 31 * result + (sex != null ? sex.hashCode() : 0);
    result = 31 * result + (province != null ? province.hashCode() : 0);
    result = 31 * result + (city != null ? city.hashCode() : 0);
    result = 31 * result + (country != null ? country.hashCode() : 0);
    result = 31 * result + (headimgurl != null ? headimgurl.hashCode() : 0);
    result = 31 * result + Arrays.hashCode(unionid);
    return result;
  }
}
